<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="lijinbo" />
    <title>046-复制文字到剪切板</title>
    <style></style>
    <script type="module" crossorigin src="../../../../static/js/046-index.html-09206ce7.js"></script>
    <link rel="modulepreload" crossorigin href="../../../../static/common/modulepreload-polyfill-3cfb730f.js">
  </head>

  <body>
    <div class="box">
      <textarea id="word" cols="30" rows="10" placeholder="请输入要复制的内容"></textarea>
    </div>
    <button id="copy">复制到剪切板</button>
    <div>
      <p>
        第三方成熟的库推荐使用 clipboard.js
        <a href="./clipboard-js.html">clipboard-js</a>
      </p>
      <a href="https://www.02405.com/archives/2045" target="_blank">clipboard</a>
      <p>如果是vue框架可以使用封装好的 vue-clipboard2</p>
      <a href="https://www.npmjs.com/package/vue-clipboard2" target="_blank">vue-clipboard2</a>
    </div>
    
  </body>
</html>
